import {getToken} from '@/utils/auth'
import TduckForm from '../../formgen/src/index'

export default {
  data() {
    return {
      formKey: null
    }
  },
  created() {
    // 写入值到localStorage 给组件使用
    if (getToken()) {
      localStorage.setItem(TduckForm.constant.ACCESS_TOKEN, 'Bearer ' + getToken())
    }
    localStorage.setItem('FORM-SUPPORT', this.$store.state.themeConfig.themeConfig.globalTitle)
    localStorage.setItem(TduckForm.constant.ACCESS_TOKEN_NAME, 'Authorization')
    localStorage.setItem(TduckForm.constant.BASE_URL, process.env['VUE_APP_API_ROOT'])
  }
}
